using UnityEngine;
using System.Collections;


[RequireComponent(typeof(Transform))]
public class GravityObject : MonoBehaviour {

	public float strength = 5f;
	
	public GravityObject() : this(5){
	}
	public GravityObject(float strength){
		this.strength=strength;	
	}
	public Vector3 getPosition(){
		return transform.position;	
	}
	/// <summary>
	/// Gets the acceleration this object imparts due to gravity. Uses basic Newtonian physics.
	/// </summary>
	/// <returns>
	/// The acceleration in the form of a 3-Dimentional vector.
	/// </returns>
	/// <param name='sourcePosition'>
	/// The position of the object being affected by this object.
	/// </param>
	public Vector3 getAcceleration(Vector3 sourcePosition){
        return V3Math.Gravity(transform.position, sourcePosition, strength);	
	}
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
	
	}
}
